﻿
SET QUOTED_IDENTIFIER ON
GO

SET ANSI_NULLS ON
GO

IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sproc_Rights_DeleteAssignRules_V2]') AND type in (N'P', N'PC'))
    DROP PROCEDURE [dbo].[sproc_Rights_DeleteAssignRules_V2];
GO
CREATE PROCEDURE [dbo].[sproc_Rights_DeleteAssignRules_V2]
    @RuleIDXml xml
/*

============================================================
功能:    删除权限集合
参数:
    @Rule_IDS nvarchar(255)        :    权限ID集合
============================================================

*/
AS
BEGIN
SET NOCOUNT ON

/*
 * XML Format
 * <rules>
 *  <r id="" />
 * </rules>
 */
DELETE
    a
FROM
    dbo.UDS_Assign_Rule a
    INNER JOIN @RuleIDXml.nodes('/rules/r') R(x) on a.Rule_ID = R.x.value('@id', 'int');

END
GO